Code extensions offer a more standardized way of Groovy usage, which makes them easier to use and upgrade because they are less prone to failure, easier to troubleshoot, and require less cleanup after an upgrade. Unlike Groovy plug-ins, code extensions are inherited in the application from the underlying framework layer. They are available in N4 version 2.0 and later.
Code extensions involve the following elements:
Extension types: The meta definition of a specific type of code extension, such as Gate Biz Task Extension or Entity Interception. The extension type specifies how and where an extension is used, providing a means to explicitly categorize and manage the use of extensions. N4 stores extension types in the extension type registry (on page 1). All extension types are global in scope.
Extension triggers: A code object (entity) that ties a code extension to a specific use case. Only used with code extensions of type ENTITY_LIFECYCLE_INTERCEPTION. Equivalent to but not the same as Groovy hooks. In N4, you can view extension triggers in the Extension Triggers view (on page 1).
Extensions: An instance of customer-defined code.
Code extensions can have a scope of Global through Facility. It is preferable to configure the code at the Operator level instead of at the Global level. Because the extension object itself is not associated with an entity, the scope for an extension is determined by the entities it is used for. At a given scope level, an extension name cannot be overridden; this means that you cannot have more than one extension named "myextension" at a given scope level. See also Scoped objects in N4 (on page 1).
When you save or update a code extension, it becomes active. To deactivate a code extension, you can do any of the following:
Disable all extensions using setting EXTSVCEXT001 (EXT_DISABLE_ALL_TRIGGERS) (on page 1). This setting disables the execution of all extension triggers.
Delete an extension from the Code Extensions view.
Disable an extension by clearing the Is Enabled check box in the Extension form.
Disable extension mapping
In general, when using code extensions, you should:
Use Entity Life Cycle Interceptors (ELI) to implement validations for an entity's persisted fields.The extension trigger configuration supports one code per entity. It is preferable to have multiple logical Library code and one ELI handler.
Use Library Code Extensions instead of Groovy plug-ins to deploy shared code.
For more information on how to implement these code extension types, see Extension Type Registry view (on page 1). The Session Factory view provides information on the entities that are enabled for code extensions (Code Extensible column).
The code extensions feature uses standardized error handling to facilitate troubleshooting. Errors that occur inside a transaction cause a transaction rollback.
For information on the Java API, see the documentation provided under Help Java API Docs.
In some N4 versions, the link to this resource is not working. As a workaround, you can access the Java API docs directly from the N4 footprint installed on your server. From within the N4 application footprint, manually open the index.html file that is located at the following location (you should only see one of the following directory paths, not both):
Navis/sparcsn4/webapps/apex/argo/api/index.html
Navis/sparcsn4/webapps/apex/model/index.html
In this Section: